home *** CD-ROM | disk | FTP | other *** search
/ Medabots Cardz / Medabots CD Cardz Sumilidon.bin / mac / assets / sumilidon.dxr / 00286_Script_286 < prev    next >
Text File  |  2001-12-07  |  9KB  |  294 lines

  1. property minuteman, tempdigits, tempscore, digit_one, digit_two, digit_three, digit_four, brassurl, tempscoreone, tempscoretwo, tempscorethree
  2. global thescore, finalcode, scoredigits, timescore, gotobrassurl, myFile, squam, oldscore, completo
  3.  
  4. on beginsprite me
  5.   completo = 0
  6.   set the floatPrecision = 0
  7.   squam = getOSdirectory()&"\"
  8.   if objectP(myFile) then set myFile = 0  --Delete the instance if it already exists
  9.   myFile = new(xtra "fileio") -- Create an instance of FileIO
  10.   --  openFile(myFile,the moviePath&"info.txt",1) --Open the file with read access
  11.   openFile(myFile,squam&"infos.txt",1) --Open the file with read access
  12.   myVariable = readFile(myFile) --set the variable 'myVariable' to the text of the file 'info.txt'
  13.   if readFile(myFile)=VOID then --checks to see if this file exists
  14.     oldscore = 0
  15.   else
  16.     oldscore = myVariable
  17.     closeFile(myFile) -- Close the file
  18.   end if
  19.   myFile = 0 -- Dispose of the instance
  20.   
  21.   
  22.   minuteman = timescore/60
  23.   
  24.   if minuteman < 60 then
  25.     thescore = 10
  26.   else if minuteman > 59 and minuteman < 120 then
  27.     thescore = 9
  28.   else if minuteman > 119 and minuteman < 180 then
  29.     thescore = 8
  30.   else if minuteman > 179 and minuteman < 240 then
  31.     thescore = 7
  32.   else if minuteman > 239 and minuteman < 360 then
  33.     thescore = 6
  34.   else if minuteman > 359 and minuteman < 420 then
  35.     thescore = 5
  36.   else if minuteman > 419 and minuteman < 480 then
  37.     thescore = 4
  38.   else if minuteman > 479 and minuteman < 540 then
  39.     thescore = 3
  40.   else if minuteman > 539 and minuteman < 600 then
  41.     thescore = 2
  42.   else
  43.     thescore = 1
  44.   end if
  45.   
  46.   thescore = thescore + oldscore
  47.   
  48.   put thescore into member("holdscore")
  49.  
  50.   
  51.   if objectP(myFile) then set myFile = 0  --Delete the instance if it already exists
  52.   myFile = new(xtra "fileio")    -- Create an instance of FileIO
  53.   --  openFile (myFile, the moviePath &"info.txt",0)--Open the file with R/W access  
  54.   openFile (myFile, squam&"infos.txt",0)--Open the file with R/W access  
  55.   delete(myFile) --deletes the file
  56.   --  createFile (myFile, the moviePath &"info.txt") --creates the file again
  57.   createFile (myFile, squam&"infos.txt") --creates the file again
  58.   --  openFile(myFile,the moviePath &"info.txt",0) --Open the file with R/W access
  59.   openFile(myFile, squam&"infos.txt",0) --Open the file with R/W access
  60.   --  mySaveString = thescore --puts the contents of the field 'input' into the variable mySaveString
  61.   mySaveString = member("holdscore").text
  62.   writeString(myFile,mySaveString) --writes text to the file
  63.   
  64.   closeFile(myFile) -- Close the file 
  65.   myFile = 0 -- Dispose of the instance
  66.   
  67.   --  put minuteman into member ("timedisplay")
  68.   --  
  69.   brassurl = "http://www.medabots.com/rewards/coding/rewards_give.pl?b=dflbnljksbvv"
  70.   
  71.   if thescore > 10000 then
  72.     thescore = 9999
  73.   end if
  74.   
  75.   if thescore > 0 and thescore <10 then
  76.     scoredigits = 1
  77.     tempscore = thescore
  78.     tempdigits = 1
  79.   else if thescore > 9 and thescore <100 then
  80.     scoredigits = 2
  81.     tempscore = thescore
  82.     tempdigits = 2
  83.   else if thescore >99 and thescore < 1000 then
  84.     scoredigits = 3
  85.     tempscore = thescore
  86.     tempdigits = 3
  87.   else if thescore >999 and thescore < 10000 then
  88.     scoredigits = 4
  89.     tempscore = thescore
  90.     tempdigits = 4
  91.   end if
  92.   
  93.   --  Four Figures
  94.   if tempdigits = 4 then
  95.     if tempscore > 999 and tempscore <2000 then
  96.       digit_four = "q"
  97.       tempscore = tempscore - 1000
  98.       tempdigits = 3
  99.     end if
  100.     if tempscore > 1999 and tempscore <3000 then
  101.       digit_four = "u"
  102.       tempscore = tempscore - 2000
  103.       tempdigits = 3
  104.     end if
  105.     if tempscore > 2999 and tempscore <4000 then
  106.       digit_four = "j"
  107.       tempscore = tempscore - 3000
  108.       tempdigits = 3
  109.     end if
  110.     if tempscore > 3999 and tempscore <5000 then
  111.       digit_four = "c"
  112.       tempscore = tempscore - 4000
  113.       tempdigits = 3
  114.     end if
  115.     if tempscore > 4999 and tempscore <6000 then
  116.       digit_four = "k"
  117.       tempscore = tempscore - 5000
  118.       tempdigits = 3
  119.     end if
  120.     if tempscore > 5999 and tempscore <7000 then
  121.       digit_four = "b"
  122.       tempscore = tempscore - 6000
  123.       tempdigits = 3
  124.     end if
  125.     if tempscore > 6999 and tempscore <8000 then
  126.       digit_four = "r"
  127.       tempscore = tempscore - 7000
  128.       tempdigits = 3
  129.     end if
  130.     if tempscore > 7999 and tempscore <9000 then
  131.       digit_four = "w"
  132.       tempscore = tempscore - 8000
  133.       tempdigits = 3
  134.     end if
  135.     if tempscore > 8999 and tempscore <10000 then
  136.       digit_four = "n"
  137.       tempscore = tempscore - 9000
  138.       tempdigits = 3
  139.     end if
  140.   end if
  141.   
  142.   
  143.   
  144.   
  145.   --  Three Figures
  146.   if tempdigits = 3 then
  147.     if tempscore < 99 then
  148.       digit_three = "x"
  149.       tempscore = tempscore
  150.       tempdigits = 2
  151.     end if
  152.     if tempscore > 99 and tempscore <200 then
  153.       digit_three = "q"
  154.       tempscore = tempscore - 100
  155.       tempdigits = 2
  156.     end if
  157.     if tempscore > 199 and tempscore <300 then
  158.       digit_three = "u"
  159.       tempscore = tempscore - 200
  160.       tempdigits = 2
  161.     end if
  162.     if tempscore > 299 and tempscore <400 then
  163.       digit_three = "j"
  164.       tempscore = tempscore - 300
  165.       tempdigits = 2
  166.     end if
  167.     if tempscore > 399 and tempscore <500 then
  168.       digit_three = "c"
  169.       tempscore = tempscore - 400
  170.       tempdigits = 2
  171.     end if
  172.     if tempscore > 499 and tempscore <600 then
  173.       digit_three = "k"
  174.       tempscore = tempscore - 500
  175.       tempdigits = 2
  176.     end if
  177.     if tempscore > 599 and tempscore <700 then
  178.       digit_three = "b"
  179.       tempscore = tempscore - 600
  180.       tempdigits = 2
  181.     end if
  182.     if tempscore > 699 and tempscore <800 then
  183.       digit_three = "r"
  184.       tempscore = tempscore - 700
  185.       tempdigits = 2
  186.     end if
  187.     if tempscore > 799 and tempscore <900 then
  188.       digit_three = "w"
  189.       tempscore = tempscore - 800
  190.       tempdigits = 2
  191.     end if
  192.     if tempscore > 899 and tempscore <1000 then
  193.       digit_three = "n"
  194.       tempscore = tempscore - 900
  195.       tempdigits = 2
  196.     end if
  197.   end if
  198.   
  199.   
  200.   --  Two Figures
  201.   if tempdigits = 2 then
  202.     if tempscore < 10 then
  203.       digit_two = "x"
  204.       tempscore = tempscore
  205.       tempdigits = 1
  206.     end if
  207.     
  208.     if tempscore > 9 and tempscore <20 then
  209.       digit_two = "q"
  210.       tempscore = tempscore - 10
  211.       tempdigits = 1
  212.     end if
  213.     if tempscore > 19 and tempscore <30 then
  214.       digit_two = "u"
  215.       tempscore = tempscore - 20
  216.       tempdigits = 1
  217.     end if
  218.     if tempscore > 29 and tempscore <40 then
  219.       digit_two = "j"
  220.       tempscore = tempscore - 30
  221.       tempdigits = 1
  222.     end if
  223.     if tempscore > 39 and tempscore <50 then
  224.       digit_two = "c"
  225.       tempscore = tempscore - 40
  226.       tempdigits = 1
  227.     end if
  228.     if tempscore > 49 and tempscore <60 then
  229.       digit_two = "k"
  230.       tempscore = tempscore - 50
  231.       tempdigits = 1
  232.     end if
  233.     if tempscore > 59 and tempscore <70 then
  234.       digit_two = "b"
  235.       tempscore = tempscore - 60
  236.       tempdigits = 1
  237.     end if 
  238.     if tempscore > 69 and tempscore <80 then
  239.       digit_two = "r"
  240.       tempscore = tempscore - 70
  241.       tempdigits = 1
  242.     end if
  243.     if tempscore > 79 and tempscore <90 then
  244.       digit_two = "w"
  245.       tempscore = tempscore - 80
  246.       tempdigits = 1
  247.     end if
  248.     if tempscore > 89 and tempscore <100 then
  249.       digit_two = "n"
  250.       tempscore = tempscore - 90
  251.       tempdigits = 1
  252.     end if
  253.     
  254.   end if
  255.   --  One Figure
  256.   if tempdigits = 1 then
  257.     if tempscore = 0 then
  258.       digit_one = "x"
  259.     else if tempscore = 1 then
  260.       digit_one = "q"
  261.     else if tempscore = 2 then
  262.       digit_one = "u"
  263.     else if tempscore = 3 then
  264.       digit_one = "j"
  265.     else if tempscore = 4 then
  266.       digit_one = "c"
  267.     else if tempscore = 5 then
  268.       digit_one = "k"
  269.     else if tempscore = 6 then
  270.       digit_one = "b"
  271.     else if tempscore = 7 then
  272.       digit_one = "r"
  273.     else if tempscore = 8 then
  274.       digit_one = "w"
  275.     else if tempscore = 9 then
  276.       digit_one = "n"
  277.     end if
  278.   end if
  279.   
  280.   if scoredigits = 1 then
  281.     finalcode = digit_one
  282.   else if scoredigits = 2 then
  283.     finalcode = digit_two&digit_one
  284.   else if scoredigits = 3 then
  285.     finalcode = digit_three&digit_two&digit_one
  286.   else if scoredigits = 4 then
  287.     finalcode = digit_four&digit_three&digit_two&digit_one
  288.   end if
  289.   
  290.   --  put brassurl&finalcode into member("urldisplay")
  291.   gotobrassurl = brassurl&finalcode
  292. end
  293.  
  294.